// 基于template/src/views/{{appModules}}/{{pages@DETREEEXPVIEW}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	TreeExpViewActionType,
	TreeExpViewController,
	ITreeExpViewAbility,
	ITreeExpViewControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useTreeExpViewProps,
	useTreeExpViewBasic,
	useTreeExpViewControllerParams,
    useTreeExpViewAction,
} from '@/hooks/view/use-tree-exp-view';
import { model } from "./ibiz-sample-0003-f-3-tree-exp-view-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useTreeExpViewProps()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useTreeExpViewBasic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useTreeExpViewAction(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<TreeExpViewActionType, ITreeExpViewAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<TreeExpViewActionType, ITreeExpViewAbility>>
) {
	const params: ITreeExpViewControllerParams<
		TreeExpViewActionType,
		ITreeExpViewAbility
	> = useTreeExpViewControllerParams(model, props, evt);
	return new TreeExpViewController(params);
}